# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_gemname=minitest-sprint
pkgname=ruby-${_gemname}
pkgver=1.2.2
pkgrel=1
pkgdesc="Runs (Get it? It's fast!) your tests and makes it easier to rerun individual failures"
url='https://github.com/seattlerb/minitest-sprint'
arch=('any')
license=('MIT')
depends=('ruby' 'ruby-minitest' 'ruby-path_expander')
makedepends=('ruby-rdoc' 'ruby-rake' 'ruby-hoe')
options=('!emptydirs')
source=(${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha512sums=('3c2d815978e03b25530497946fe193b12edba83df621418c30833a2ee7e02e7be40e9f6ac11954bfca65606745cdeaa38a781976aea7de7621ed07d9b0f15fb5')
b2sums=('342db7ca15e0351abdbed58dd0d037a40883c913fb8042ec1a3eca328efa4cf9dff24628e957db54c3bc9468a0cd90a723874de5bcd5eeb59053952a6ee7ebac')

build() {
  cd ${_gemname}-${pkgver}
  sed -r 's|~>|>=|g' -i Rakefile
  rake gem
}

check() {
  cd ${_gemname}-${pkgver}
  rake test
}

package() {
  cd ${_gemname}-${pkgver}
  local _gemdir="$(gem env gemdir)"
  gem install --ignore-dependencies --no-user-install -i "${pkgdir}${_gemdir}" \
    -n "${pkgdir}/usr/bin" pkg/${_gemname}-${pkgver}.gem

  install -Dm 644 README.rdoc History.rdoc -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 README.rdoc -t "${pkgdir}/usr/share/licenses/${pkgname}"

  rm -r "${pkgdir}/${_gemdir}/"{cache,gems/${_gemname}-${pkgver}/test}
}

# vim: ts=2 sw=2 et:
